//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension ServiceQuotas {
    // MARK: Enums

    public enum AppliedLevelEnum: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case account = "ACCOUNT"
        case all = "ALL"
        case resource = "RESOURCE"
        public var description: String { return self.rawValue }
    }

    public enum ErrorCode: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case dependencyAccessDeniedError = "DEPENDENCY_ACCESS_DENIED_ERROR"
        case dependencyServiceError = "DEPENDENCY_SERVICE_ERROR"
        case dependencyThrottlingError = "DEPENDENCY_THROTTLING_ERROR"
        case serviceQuotaNotAvailableError = "SERVICE_QUOTA_NOT_AVAILABLE_ERROR"
        public var description: String { return self.rawValue }
    }

    public enum PeriodUnit: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case day = "DAY"
        case hour = "HOUR"
        case microsecond = "MICROSECOND"
        case millisecond = "MILLISECOND"
        case minute = "MINUTE"
        case second = "SECOND"
        case week = "WEEK"
        public var description: String { return self.rawValue }
    }

    public enum QuotaContextScope: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case account = "ACCOUNT"
        case resource = "RESOURCE"
        public var description: String { return self.rawValue }
    }

    public enum RequestStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case approved = "APPROVED"
        case caseClosed = "CASE_CLOSED"
        case caseOpened = "CASE_OPENED"
        case denied = "DENIED"
        case invalidRequest = "INVALID_REQUEST"
        case notApproved = "NOT_APPROVED"
        case pending = "PENDING"
        public var description: String { return self.rawValue }
    }

    public enum ServiceQuotaTemplateAssociationStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case associated = "ASSOCIATED"
        case disassociated = "DISASSOCIATED"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AssociateServiceQuotaTemplateRequest: AWSEncodableShape {
        public init() {}
    }

    public struct AssociateServiceQuotaTemplateResponse: AWSDecodableShape {
        public init() {}
    }

    public struct CreateSupportCaseRequest: AWSEncodableShape {
        /// The ID of the pending quota increase request for which you want to open a Support case.
        public let requestId: String

        @inlinable
        public init(requestId: String) {
            self.requestId = requestId
        }

        public func validate(name: String) throws {
            try self.validate(self.requestId, name: "requestId", parent: name, max: 128)
            try self.validate(self.requestId, name: "requestId", parent: name, min: 1)
            try self.validate(self.requestId, name: "requestId", parent: name, pattern: "^[0-9a-zA-Z][a-zA-Z0-9-]{1,128}$")
        }

        private enum CodingKeys: String, CodingKey {
            case requestId = "RequestId"
        }
    }

    public struct CreateSupportCaseResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteServiceQuotaIncreaseRequestFromTemplateRequest: AWSEncodableShape {
        /// Specifies the Amazon Web Services Region for which the request was made.
        public let awsRegion: String
        /// Specifies the quota identifier. To find the quota code for a specific  quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.
        public let quotaCode: String
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String

        @inlinable
        public init(awsRegion: String, quotaCode: String, serviceCode: String) {
            self.awsRegion = awsRegion
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, max: 64)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, min: 1)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,128}$")
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,128}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,63}$")
        }

        private enum CodingKeys: String, CodingKey {
            case awsRegion = "AwsRegion"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct DeleteServiceQuotaIncreaseRequestFromTemplateResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DisassociateServiceQuotaTemplateRequest: AWSEncodableShape {
        public init() {}
    }

    public struct DisassociateServiceQuotaTemplateResponse: AWSDecodableShape {
        public init() {}
    }

    public struct ErrorReason: AWSDecodableShape {
        /// Service Quotas returns the following error values:    DEPENDENCY_ACCESS_DENIED_ERROR - The caller does not have the required permissions to complete the action. To resolve the error, you must have permission to access the Amazon Web Services service or quota.    DEPENDENCY_THROTTLING_ERROR - The Amazon Web Services service is throttling Service Quotas.     DEPENDENCY_SERVICE_ERROR - The Amazon Web Services service is not available.    SERVICE_QUOTA_NOT_AVAILABLE_ERROR - There was an error in Service Quotas.
        public let errorCode: ErrorCode?
        /// The error message.
        public let errorMessage: String?

        @inlinable
        public init(errorCode: ErrorCode? = nil, errorMessage: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
        }
    }

    public struct GetAWSDefaultServiceQuotaRequest: AWSEncodableShape {
        /// Specifies the quota identifier. To find the quota code for a specific  quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.
        public let quotaCode: String
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String

        @inlinable
        public init(quotaCode: String, serviceCode: String) {
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,128}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,63}$")
        }

        private enum CodingKeys: String, CodingKey {
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct GetAWSDefaultServiceQuotaResponse: AWSDecodableShape {
        /// Information about the quota.
        public let quota: ServiceQuota?

        @inlinable
        public init(quota: ServiceQuota? = nil) {
            self.quota = quota
        }

        private enum CodingKeys: String, CodingKey {
            case quota = "Quota"
        }
    }

    public struct GetAssociationForServiceQuotaTemplateRequest: AWSEncodableShape {
        public init() {}
    }

    public struct GetAssociationForServiceQuotaTemplateResponse: AWSDecodableShape {
        /// The association status. If the status is ASSOCIATED, the quota increase requests in the template are automatically applied to new Amazon Web Services accounts in your organization.
        public let serviceQuotaTemplateAssociationStatus: ServiceQuotaTemplateAssociationStatus?

        @inlinable
        public init(serviceQuotaTemplateAssociationStatus: ServiceQuotaTemplateAssociationStatus? = nil) {
            self.serviceQuotaTemplateAssociationStatus = serviceQuotaTemplateAssociationStatus
        }

        private enum CodingKeys: String, CodingKey {
            case serviceQuotaTemplateAssociationStatus = "ServiceQuotaTemplateAssociationStatus"
        }
    }

    public struct GetRequestedServiceQuotaChangeRequest: AWSEncodableShape {
        /// Specifies the ID of the quota increase request.
        public let requestId: String

        @inlinable
        public init(requestId: String) {
            self.requestId = requestId
        }

        public func validate(name: String) throws {
            try self.validate(self.requestId, name: "requestId", parent: name, max: 128)
            try self.validate(self.requestId, name: "requestId", parent: name, min: 1)
            try self.validate(self.requestId, name: "requestId", parent: name, pattern: "^[0-9a-zA-Z][a-zA-Z0-9-]{1,128}$")
        }

        private enum CodingKeys: String, CodingKey {
            case requestId = "RequestId"
        }
    }

    public struct GetRequestedServiceQuotaChangeResponse: AWSDecodableShape {
        /// Information about the quota increase request.
        public let requestedQuota: RequestedServiceQuotaChange?

        @inlinable
        public init(requestedQuota: RequestedServiceQuotaChange? = nil) {
            self.requestedQuota = requestedQuota
        }

        private enum CodingKeys: String, CodingKey {
            case requestedQuota = "RequestedQuota"
        }
    }

    public struct GetServiceQuotaIncreaseRequestFromTemplateRequest: AWSEncodableShape {
        /// Specifies the Amazon Web Services Region for which you made the request.
        public let awsRegion: String
        /// Specifies the quota identifier. To find the quota code for a specific  quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.
        public let quotaCode: String
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String

        @inlinable
        public init(awsRegion: String, quotaCode: String, serviceCode: String) {
            self.awsRegion = awsRegion
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, max: 64)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, min: 1)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,128}$")
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,128}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,63}$")
        }

        private enum CodingKeys: String, CodingKey {
            case awsRegion = "AwsRegion"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct GetServiceQuotaIncreaseRequestFromTemplateResponse: AWSDecodableShape {
        /// Information about the quota increase request.
        public let serviceQuotaIncreaseRequestInTemplate: ServiceQuotaIncreaseRequestInTemplate?

        @inlinable
        public init(serviceQuotaIncreaseRequestInTemplate: ServiceQuotaIncreaseRequestInTemplate? = nil) {
            self.serviceQuotaIncreaseRequestInTemplate = serviceQuotaIncreaseRequestInTemplate
        }

        private enum CodingKeys: String, CodingKey {
            case serviceQuotaIncreaseRequestInTemplate = "ServiceQuotaIncreaseRequestInTemplate"
        }
    }

    public struct GetServiceQuotaRequest: AWSEncodableShape {
        /// Specifies the resource with an Amazon Resource Name (ARN).
        public let contextId: String?
        /// Specifies the quota identifier. To find the quota code for a specific  quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.
        public let quotaCode: String
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String

        @inlinable
        public init(contextId: String? = nil, quotaCode: String, serviceCode: String) {
            self.contextId = contextId
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,128}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,63}$")
        }

        private enum CodingKeys: String, CodingKey {
            case contextId = "ContextId"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct GetServiceQuotaResponse: AWSDecodableShape {
        /// Information about the quota.
        public let quota: ServiceQuota?

        @inlinable
        public init(quota: ServiceQuota? = nil) {
            self.quota = quota
        }

        private enum CodingKeys: String, CodingKey {
            case quota = "Quota"
        }
    }

    public struct ListAWSDefaultServiceQuotasRequest: AWSEncodableShape {
        /// Specifies the maximum number of results that you want included on each  page of the response. If you do not include this parameter, it defaults to a value appropriate  to the operation. If additional items exist beyond those included in the current response, the  NextToken response element is present and has a value (is not null). Include that  value as the NextToken request parameter in the next call to the operation to get  the next part of the results.  An API operation can return fewer results than the maximum even when there are  more results available. You should check NextToken after every operation to ensure  that you receive all of the results.
        public let maxResults: Int?
        /// Specifies a value for receiving additional results after you  receive a NextToken response in a previous request. A NextToken  response indicates that more output is available. Set this parameter to the value of the previous  call's NextToken response to indicate where the output should continue  from.
        public let nextToken: String?
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil, serviceCode: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[a-zA-Z0-9/+]*={0,2}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,63}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case serviceCode = "ServiceCode"
        }
    }

    public struct ListAWSDefaultServiceQuotasResponse: AWSDecodableShape {
        /// If present, indicates that more output is available than is  included in the current response. Use this value in the NextToken request parameter  in a subsequent call to the operation to get the next part of the output. You should repeat this  until the NextToken response element comes back as null.
        public let nextToken: String?
        /// Information about the quotas.
        public let quotas: [ServiceQuota]?

        @inlinable
        public init(nextToken: String? = nil, quotas: [ServiceQuota]? = nil) {
            self.nextToken = nextToken
            self.quotas = quotas
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case quotas = "Quotas"
        }
    }

    public struct ListRequestedServiceQuotaChangeHistoryByQuotaRequest: AWSEncodableShape {
        /// Specifies the maximum number of results that you want included on each  page of the response. If you do not include this parameter, it defaults to a value appropriate  to the operation. If additional items exist beyond those included in the current response, the  NextToken response element is present and has a value (is not null). Include that  value as the NextToken request parameter in the next call to the operation to get  the next part of the results.  An API operation can return fewer results than the maximum even when there are  more results available. You should check NextToken after every operation to ensure  that you receive all of the results.
        public let maxResults: Int?
        /// Specifies a value for receiving additional results after you  receive a NextToken response in a previous request. A NextToken  response indicates that more output is available. Set this parameter to the value of the previous  call's NextToken response to indicate where the output should continue  from.
        public let nextToken: String?
        /// Specifies the quota identifier. To find the quota code for a specific  quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.
        public let quotaCode: String
        /// Filters the response to return quota requests for the ACCOUNT, RESOURCE, or ALL levels. ACCOUNT is the default.
        public let quotaRequestedAtLevel: AppliedLevelEnum?
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String
        /// Specifies that you want to filter the results to only the requests with the matching status.
        public let status: RequestStatus?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil, quotaCode: String, quotaRequestedAtLevel: AppliedLevelEnum? = nil, serviceCode: String, status: RequestStatus? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.quotaCode = quotaCode
            self.quotaRequestedAtLevel = quotaRequestedAtLevel
            self.serviceCode = serviceCode
            self.status = status
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[a-zA-Z0-9/+]*={0,2}$")
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,128}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,63}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case quotaCode = "QuotaCode"
            case quotaRequestedAtLevel = "QuotaRequestedAtLevel"
            case serviceCode = "ServiceCode"
            case status = "Status"
        }
    }

    public struct ListRequestedServiceQuotaChangeHistoryByQuotaResponse: AWSDecodableShape {
        /// If present, indicates that more output is available than is  included in the current response. Use this value in the NextToken request parameter  in a subsequent call to the operation to get the next part of the output. You should repeat this  until the NextToken response element comes back as null.
        public let nextToken: String?
        /// Information about the quota increase requests.
        public let requestedQuotas: [RequestedServiceQuotaChange]?

        @inlinable
        public init(nextToken: String? = nil, requestedQuotas: [RequestedServiceQuotaChange]? = nil) {
            self.nextToken = nextToken
            self.requestedQuotas = requestedQuotas
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case requestedQuotas = "RequestedQuotas"
        }
    }

    public struct ListRequestedServiceQuotaChangeHistoryRequest: AWSEncodableShape {
        /// Specifies the maximum number of results that you want included on each  page of the response. If you do not include this parameter, it defaults to a value appropriate  to the operation. If additional items exist beyond those included in the current response, the  NextToken response element is present and has a value (is not null). Include that  value as the NextToken request parameter in the next call to the operation to get  the next part of the results.  An API operation can return fewer results than the maximum even when there are  more results available. You should check NextToken after every operation to ensure  that you receive all of the results.
        public let maxResults: Int?
        /// Specifies a value for receiving additional results after you  receive a NextToken response in a previous request. A NextToken  response indicates that more output is available. Set this parameter to the value of the previous  call's NextToken response to indicate where the output should continue  from.
        public let nextToken: String?
        /// Filters the response to return quota requests for the ACCOUNT, RESOURCE, or ALL levels. ACCOUNT is the default.
        public let quotaRequestedAtLevel: AppliedLevelEnum?
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String?
        /// Specifies that you want to filter the results to only the requests with the matching status.
        public let status: RequestStatus?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil, quotaRequestedAtLevel: AppliedLevelEnum? = nil, serviceCode: String? = nil, status: RequestStatus? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.quotaRequestedAtLevel = quotaRequestedAtLevel
            self.serviceCode = serviceCode
            self.status = status
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[a-zA-Z0-9/+]*={0,2}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,63}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case quotaRequestedAtLevel = "QuotaRequestedAtLevel"
            case serviceCode = "ServiceCode"
            case status = "Status"
        }
    }

    public struct ListRequestedServiceQuotaChangeHistoryResponse: AWSDecodableShape {
        /// If present, indicates that more output is available than is  included in the current response. Use this value in the NextToken request parameter  in a subsequent call to the operation to get the next part of the output. You should repeat this  until the NextToken response element comes back as null.
        public let nextToken: String?
        /// Information about the quota increase requests.
        public let requestedQuotas: [RequestedServiceQuotaChange]?

        @inlinable
        public init(nextToken: String? = nil, requestedQuotas: [RequestedServiceQuotaChange]? = nil) {
            self.nextToken = nextToken
            self.requestedQuotas = requestedQuotas
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case requestedQuotas = "RequestedQuotas"
        }
    }

    public struct ListServiceQuotaIncreaseRequestsInTemplateRequest: AWSEncodableShape {
        /// Specifies the Amazon Web Services Region for which you made the request.
        public let awsRegion: String?
        /// Specifies the maximum number of results that you want included on each  page of the response. If you do not include this parameter, it defaults to a value appropriate  to the operation. If additional items exist beyond those included in the current response, the  NextToken response element is present and has a value (is not null). Include that  value as the NextToken request parameter in the next call to the operation to get  the next part of the results.  An API operation can return fewer results than the maximum even when there are  more results available. You should check NextToken after every operation to ensure  that you receive all of the results.
        public let maxResults: Int?
        /// Specifies a value for receiving additional results after you  receive a NextToken response in a previous request. A NextToken  response indicates that more output is available. Set this parameter to the value of the previous  call's NextToken response to indicate where the output should continue  from.
        public let nextToken: String?
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String?

        @inlinable
        public init(awsRegion: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, serviceCode: String? = nil) {
            self.awsRegion = awsRegion
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, max: 64)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, min: 1)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,128}$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[a-zA-Z0-9/+]*={0,2}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,63}$")
        }

        private enum CodingKeys: String, CodingKey {
            case awsRegion = "AwsRegion"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case serviceCode = "ServiceCode"
        }
    }

    public struct ListServiceQuotaIncreaseRequestsInTemplateResponse: AWSDecodableShape {
        /// If present, indicates that more output is available than is  included in the current response. Use this value in the NextToken request parameter  in a subsequent call to the operation to get the next part of the output. You should repeat this  until the NextToken response element comes back as null.
        public let nextToken: String?
        /// Information about the quota increase requests.
        public let serviceQuotaIncreaseRequestInTemplateList: [ServiceQuotaIncreaseRequestInTemplate]?

        @inlinable
        public init(nextToken: String? = nil, serviceQuotaIncreaseRequestInTemplateList: [ServiceQuotaIncreaseRequestInTemplate]? = nil) {
            self.nextToken = nextToken
            self.serviceQuotaIncreaseRequestInTemplateList = serviceQuotaIncreaseRequestInTemplateList
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case serviceQuotaIncreaseRequestInTemplateList = "ServiceQuotaIncreaseRequestInTemplateList"
        }
    }

    public struct ListServiceQuotasRequest: AWSEncodableShape {
        /// Specifies the maximum number of results that you want included on each  page of the response. If you do not include this parameter, it defaults to a value appropriate  to the operation. If additional items exist beyond those included in the current response, the  NextToken response element is present and has a value (is not null). Include that  value as the NextToken request parameter in the next call to the operation to get  the next part of the results.  An API operation can return fewer results than the maximum even when there are  more results available. You should check NextToken after every operation to ensure  that you receive all of the results.
        public let maxResults: Int?
        /// Specifies a value for receiving additional results after you  receive a NextToken response in a previous request. A NextToken  response indicates that more output is available. Set this parameter to the value of the previous  call's NextToken response to indicate where the output should continue  from.
        public let nextToken: String?
        /// Filters the response to return applied quota values for the ACCOUNT, RESOURCE, or ALL levels. ACCOUNT is the default.
        public let quotaAppliedAtLevel: AppliedLevelEnum?
        /// Specifies the quota identifier. To find the quota code for a specific  quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.
        public let quotaCode: String?
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil, quotaAppliedAtLevel: AppliedLevelEnum? = nil, quotaCode: String? = nil, serviceCode: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.quotaAppliedAtLevel = quotaAppliedAtLevel
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[a-zA-Z0-9/+]*={0,2}$")
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,128}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,63}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case quotaAppliedAtLevel = "QuotaAppliedAtLevel"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct ListServiceQuotasResponse: AWSDecodableShape {
        /// If present, indicates that more output is available than is  included in the current response. Use this value in the NextToken request parameter  in a subsequent call to the operation to get the next part of the output. You should repeat this  until the NextToken response element comes back as null.
        public let nextToken: String?
        /// Information about the quotas.
        public let quotas: [ServiceQuota]?

        @inlinable
        public init(nextToken: String? = nil, quotas: [ServiceQuota]? = nil) {
            self.nextToken = nextToken
            self.quotas = quotas
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case quotas = "Quotas"
        }
    }

    public struct ListServicesRequest: AWSEncodableShape {
        /// Specifies the maximum number of results that you want included on each  page of the response. If you do not include this parameter, it defaults to a value appropriate  to the operation. If additional items exist beyond those included in the current response, the  NextToken response element is present and has a value (is not null). Include that  value as the NextToken request parameter in the next call to the operation to get  the next part of the results.  An API operation can return fewer results than the maximum even when there are  more results available. You should check NextToken after every operation to ensure  that you receive all of the results.
        public let maxResults: Int?
        /// Specifies a value for receiving additional results after you  receive a NextToken response in a previous request. A NextToken  response indicates that more output is available. Set this parameter to the value of the previous  call's NextToken response to indicate where the output should continue  from.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[a-zA-Z0-9/+]*={0,2}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListServicesResponse: AWSDecodableShape {
        /// If present, indicates that more output is available than is  included in the current response. Use this value in the NextToken request parameter  in a subsequent call to the operation to get the next part of the output. You should repeat this  until the NextToken response element comes back as null.
        public let nextToken: String?
        /// The list of the Amazon Web Services service names and service codes.
        public let services: [ServiceInfo]?

        @inlinable
        public init(nextToken: String? = nil, services: [ServiceInfo]? = nil) {
            self.nextToken = nextToken
            self.services = services
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case services = "Services"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for the applied quota for which you want to list tags. You can get this information by using the Service Quotas console, or by listing the quotas using the list-service-quotas CLI command or the ListServiceQuotas Amazon Web Services API operation.
        public let resourceARN: String

        @inlinable
        public init(resourceARN: String) {
            self.resourceARN = resourceARN
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, pattern: "^arn:aws(-[\\w]+)*:*:.+:[0-9]{12}:.+$")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
        }
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// A complex data type that contains zero or more tag elements.
        public let tags: [Tag]?

        @inlinable
        public init(tags: [Tag]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct MetricInfo: AWSDecodableShape {
        /// The metric dimension. This is a name/value pair that is part of the identity of a metric.
        public let metricDimensions: [String: String]?
        /// The name of the metric.
        public let metricName: String?
        /// The namespace of the metric.
        public let metricNamespace: String?
        /// The metric statistic that we recommend you use when determining quota usage.
        public let metricStatisticRecommendation: String?

        @inlinable
        public init(metricDimensions: [String: String]? = nil, metricName: String? = nil, metricNamespace: String? = nil, metricStatisticRecommendation: String? = nil) {
            self.metricDimensions = metricDimensions
            self.metricName = metricName
            self.metricNamespace = metricNamespace
            self.metricStatisticRecommendation = metricStatisticRecommendation
        }

        private enum CodingKeys: String, CodingKey {
            case metricDimensions = "MetricDimensions"
            case metricName = "MetricName"
            case metricNamespace = "MetricNamespace"
            case metricStatisticRecommendation = "MetricStatisticRecommendation"
        }
    }

    public struct PutServiceQuotaIncreaseRequestIntoTemplateRequest: AWSEncodableShape {
        /// Specifies the Amazon Web Services Region to which the template applies.
        public let awsRegion: String
        /// Specifies the new, increased value for the quota.
        public let desiredValue: Double
        /// Specifies the quota identifier. To find the quota code for a specific  quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.
        public let quotaCode: String
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String

        @inlinable
        public init(awsRegion: String, desiredValue: Double, quotaCode: String, serviceCode: String) {
            self.awsRegion = awsRegion
            self.desiredValue = desiredValue
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        public func validate(name: String) throws {
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, max: 64)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, min: 1)
            try self.validate(self.awsRegion, name: "awsRegion", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,128}$")
            try self.validate(self.desiredValue, name: "desiredValue", parent: name, max: 10000000000.0)
            try self.validate(self.desiredValue, name: "desiredValue", parent: name, min: 0.0)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,128}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,63}$")
        }

        private enum CodingKeys: String, CodingKey {
            case awsRegion = "AwsRegion"
            case desiredValue = "DesiredValue"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct PutServiceQuotaIncreaseRequestIntoTemplateResponse: AWSDecodableShape {
        /// Information about the quota increase request.
        public let serviceQuotaIncreaseRequestInTemplate: ServiceQuotaIncreaseRequestInTemplate?

        @inlinable
        public init(serviceQuotaIncreaseRequestInTemplate: ServiceQuotaIncreaseRequestInTemplate? = nil) {
            self.serviceQuotaIncreaseRequestInTemplate = serviceQuotaIncreaseRequestInTemplate
        }

        private enum CodingKeys: String, CodingKey {
            case serviceQuotaIncreaseRequestInTemplate = "ServiceQuotaIncreaseRequestInTemplate"
        }
    }

    public struct QuotaContextInfo: AWSDecodableShape {
        /// Specifies the resource, or resources, to which the quota applies. The value for this field is either an Amazon Resource Name (ARN) or *. If the value is an ARN, the quota value applies to that resource. If the value is *, then the quota value applies to all resources listed in the ContextScopeType field. The quota value applies to all resources for which you haven’t previously applied a quota value, and any new resources you create in your Amazon Web Services account.
        public let contextId: String?
        /// Specifies the scope to which the quota value is applied. If the scope is RESOURCE, the quota value is applied to each resource in the Amazon Web Services account. If the scope is ACCOUNT, the quota value is applied to the Amazon Web Services account.
        public let contextScope: QuotaContextScope?
        /// Specifies the resource type to which the quota can be applied.
        public let contextScopeType: String?

        @inlinable
        public init(contextId: String? = nil, contextScope: QuotaContextScope? = nil, contextScopeType: String? = nil) {
            self.contextId = contextId
            self.contextScope = contextScope
            self.contextScopeType = contextScopeType
        }

        private enum CodingKeys: String, CodingKey {
            case contextId = "ContextId"
            case contextScope = "ContextScope"
            case contextScopeType = "ContextScopeType"
        }
    }

    public struct QuotaPeriod: AWSDecodableShape {
        /// The time unit.
        public let periodUnit: PeriodUnit?
        /// The value associated with the reported PeriodUnit.
        public let periodValue: Int?

        @inlinable
        public init(periodUnit: PeriodUnit? = nil, periodValue: Int? = nil) {
            self.periodUnit = periodUnit
            self.periodValue = periodValue
        }

        private enum CodingKeys: String, CodingKey {
            case periodUnit = "PeriodUnit"
            case periodValue = "PeriodValue"
        }
    }

    public struct RequestServiceQuotaIncreaseRequest: AWSEncodableShape {
        /// Specifies the resource with an Amazon Resource Name (ARN).
        public let contextId: String?
        /// Specifies the new, increased value for the quota.
        public let desiredValue: Double
        /// Specifies the quota identifier. To find the quota code for a specific  quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.
        public let quotaCode: String
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String
        /// Specifies if an Amazon Web Services Support case can be opened for the quota increase request. This parameter is optional.  By default, this flag is set to True and Amazon Web Services may create a support case for some quota increase requests.  You can set this flag to False  if you do not want a support case created when you request a quota increase. If you set the flag to False,  Amazon Web Services does not open a support case and updates the request status to Not approved.
        public let supportCaseAllowed: Bool?

        @inlinable
        public init(contextId: String? = nil, desiredValue: Double, quotaCode: String, serviceCode: String, supportCaseAllowed: Bool? = nil) {
            self.contextId = contextId
            self.desiredValue = desiredValue
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
            self.supportCaseAllowed = supportCaseAllowed
        }

        public func validate(name: String) throws {
            try self.validate(self.desiredValue, name: "desiredValue", parent: name, max: 10000000000.0)
            try self.validate(self.desiredValue, name: "desiredValue", parent: name, min: 0.0)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, max: 128)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, min: 1)
            try self.validate(self.quotaCode, name: "quotaCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,128}$")
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, max: 63)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, min: 1)
            try self.validate(self.serviceCode, name: "serviceCode", parent: name, pattern: "^[a-zA-Z][a-zA-Z0-9-]{1,63}$")
        }

        private enum CodingKeys: String, CodingKey {
            case contextId = "ContextId"
            case desiredValue = "DesiredValue"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
            case supportCaseAllowed = "SupportCaseAllowed"
        }
    }

    public struct RequestServiceQuotaIncreaseResponse: AWSDecodableShape {
        /// Information about the quota increase request.
        public let requestedQuota: RequestedServiceQuotaChange?

        @inlinable
        public init(requestedQuota: RequestedServiceQuotaChange? = nil) {
            self.requestedQuota = requestedQuota
        }

        private enum CodingKeys: String, CodingKey {
            case requestedQuota = "RequestedQuota"
        }
    }

    public struct RequestedServiceQuotaChange: AWSDecodableShape {
        /// The case ID.
        public let caseId: String?
        /// The date and time when the quota increase request was received and the case ID was created.
        public let created: Date?
        /// The new, increased value for the quota.
        public let desiredValue: Double?
        /// Indicates whether the quota is global.
        public let globalQuota: Bool?
        /// The unique identifier.
        public let id: String?
        /// The date and time of the most recent change.
        public let lastUpdated: Date?
        /// The Amazon Resource Name (ARN) of the quota.
        public let quotaArn: String?
        /// Specifies the quota identifier. To find the quota code for a specific  quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.
        public let quotaCode: String?
        /// The context for this service quota.
        public let quotaContext: QuotaContextInfo?
        /// Specifies the quota name.
        public let quotaName: String?
        /// Filters the response to return quota requests for the ACCOUNT, RESOURCE, or ALL levels. ACCOUNT is the default.
        public let quotaRequestedAtLevel: AppliedLevelEnum?
        /// The IAM identity of the requester.
        public let requester: String?
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String?
        /// Specifies the service name.
        public let serviceName: String?
        /// The state of the quota increase request.    PENDING: The quota increase request is under review by Amazon Web Services.     CASE_OPENED: Service Quotas opened a support case to process the quota increase request. Follow-up on the support case for more information.    APPROVED: The quota increase request is approved.     DENIED: The quota increase request can't be approved by Service Quotas. Contact Amazon Web Services Support for more details.    NOT APPROVED: The quota increase request can't be approved by Service Quotas. Contact Amazon Web Services Support for more details.    CASE_CLOSED: The support case associated with this quota increase request was closed. Check the support case correspondence for the outcome of your quota request.    INVALID_REQUEST: Service Quotas couldn't process your resource-level quota increase request because the Amazon Resource Name (ARN) specified as part of the ContextId is invalid.
        public let status: RequestStatus?
        /// The unit of measurement.
        public let unit: String?

        @inlinable
        public init(caseId: String? = nil, created: Date? = nil, desiredValue: Double? = nil, globalQuota: Bool? = nil, id: String? = nil, lastUpdated: Date? = nil, quotaArn: String? = nil, quotaCode: String? = nil, quotaContext: QuotaContextInfo? = nil, quotaName: String? = nil, quotaRequestedAtLevel: AppliedLevelEnum? = nil, requester: String? = nil, serviceCode: String? = nil, serviceName: String? = nil, status: RequestStatus? = nil, unit: String? = nil) {
            self.caseId = caseId
            self.created = created
            self.desiredValue = desiredValue
            self.globalQuota = globalQuota
            self.id = id
            self.lastUpdated = lastUpdated
            self.quotaArn = quotaArn
            self.quotaCode = quotaCode
            self.quotaContext = quotaContext
            self.quotaName = quotaName
            self.quotaRequestedAtLevel = quotaRequestedAtLevel
            self.requester = requester
            self.serviceCode = serviceCode
            self.serviceName = serviceName
            self.status = status
            self.unit = unit
        }

        private enum CodingKeys: String, CodingKey {
            case caseId = "CaseId"
            case created = "Created"
            case desiredValue = "DesiredValue"
            case globalQuota = "GlobalQuota"
            case id = "Id"
            case lastUpdated = "LastUpdated"
            case quotaArn = "QuotaArn"
            case quotaCode = "QuotaCode"
            case quotaContext = "QuotaContext"
            case quotaName = "QuotaName"
            case quotaRequestedAtLevel = "QuotaRequestedAtLevel"
            case requester = "Requester"
            case serviceCode = "ServiceCode"
            case serviceName = "ServiceName"
            case status = "Status"
            case unit = "Unit"
        }
    }

    public struct ServiceInfo: AWSDecodableShape {
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String?
        /// Specifies the service name.
        public let serviceName: String?

        @inlinable
        public init(serviceCode: String? = nil, serviceName: String? = nil) {
            self.serviceCode = serviceCode
            self.serviceName = serviceName
        }

        private enum CodingKeys: String, CodingKey {
            case serviceCode = "ServiceCode"
            case serviceName = "ServiceName"
        }
    }

    public struct ServiceQuota: AWSDecodableShape {
        /// Indicates whether the quota value can be increased.
        public let adjustable: Bool?
        /// The quota description.
        public let description: String?
        /// The error code and error reason.
        public let errorReason: ErrorReason?
        /// Indicates whether the quota is global.
        public let globalQuota: Bool?
        /// The period of time.
        public let period: QuotaPeriod?
        /// Filters the response to return applied quota values for the ACCOUNT, RESOURCE, or ALL levels. ACCOUNT is the default.
        public let quotaAppliedAtLevel: AppliedLevelEnum?
        /// The Amazon Resource Name (ARN) of the quota.
        public let quotaArn: String?
        /// Specifies the quota identifier. To find the quota code for a specific  quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.
        public let quotaCode: String?
        /// The context for this service quota.
        public let quotaContext: QuotaContextInfo?
        /// Specifies the quota name.
        public let quotaName: String?
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String?
        /// Specifies the service name.
        public let serviceName: String?
        /// The unit of measurement.
        public let unit: String?
        /// Information about the measurement.
        public let usageMetric: MetricInfo?
        /// The quota value.
        public let value: Double?

        @inlinable
        public init(adjustable: Bool? = nil, description: String? = nil, errorReason: ErrorReason? = nil, globalQuota: Bool? = nil, period: QuotaPeriod? = nil, quotaAppliedAtLevel: AppliedLevelEnum? = nil, quotaArn: String? = nil, quotaCode: String? = nil, quotaContext: QuotaContextInfo? = nil, quotaName: String? = nil, serviceCode: String? = nil, serviceName: String? = nil, unit: String? = nil, usageMetric: MetricInfo? = nil, value: Double? = nil) {
            self.adjustable = adjustable
            self.description = description
            self.errorReason = errorReason
            self.globalQuota = globalQuota
            self.period = period
            self.quotaAppliedAtLevel = quotaAppliedAtLevel
            self.quotaArn = quotaArn
            self.quotaCode = quotaCode
            self.quotaContext = quotaContext
            self.quotaName = quotaName
            self.serviceCode = serviceCode
            self.serviceName = serviceName
            self.unit = unit
            self.usageMetric = usageMetric
            self.value = value
        }

        private enum CodingKeys: String, CodingKey {
            case adjustable = "Adjustable"
            case description = "Description"
            case errorReason = "ErrorReason"
            case globalQuota = "GlobalQuota"
            case period = "Period"
            case quotaAppliedAtLevel = "QuotaAppliedAtLevel"
            case quotaArn = "QuotaArn"
            case quotaCode = "QuotaCode"
            case quotaContext = "QuotaContext"
            case quotaName = "QuotaName"
            case serviceCode = "ServiceCode"
            case serviceName = "ServiceName"
            case unit = "Unit"
            case usageMetric = "UsageMetric"
            case value = "Value"
        }
    }

    public struct ServiceQuotaIncreaseRequestInTemplate: AWSDecodableShape {
        /// The Amazon Web Services Region.
        public let awsRegion: String?
        /// The new, increased value of the quota.
        public let desiredValue: Double?
        /// Indicates whether the quota is global.
        public let globalQuota: Bool?
        /// Specifies the quota identifier. To find the quota code for a specific  quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.
        public let quotaCode: String?
        /// Specifies the quota name.
        public let quotaName: String?
        /// Specifies the service identifier. To find the service code value  for an Amazon Web Services service, use the ListServices operation.
        public let serviceCode: String?
        /// Specifies the service name.
        public let serviceName: String?
        /// The unit of measurement.
        public let unit: String?

        @inlinable
        public init(awsRegion: String? = nil, desiredValue: Double? = nil, globalQuota: Bool? = nil, quotaCode: String? = nil, quotaName: String? = nil, serviceCode: String? = nil, serviceName: String? = nil, unit: String? = nil) {
            self.awsRegion = awsRegion
            self.desiredValue = desiredValue
            self.globalQuota = globalQuota
            self.quotaCode = quotaCode
            self.quotaName = quotaName
            self.serviceCode = serviceCode
            self.serviceName = serviceName
            self.unit = unit
        }

        private enum CodingKeys: String, CodingKey {
            case awsRegion = "AwsRegion"
            case desiredValue = "DesiredValue"
            case globalQuota = "GlobalQuota"
            case quotaCode = "QuotaCode"
            case quotaName = "QuotaName"
            case serviceCode = "ServiceCode"
            case serviceName = "ServiceName"
            case unit = "Unit"
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// A string that contains a tag key. The string length should be between 1 and 128 characters. Valid characters include a-z, A-Z, 0-9, space, and the special characters _ - . : / = + @.
        public let key: String
        /// A string that contains an optional tag value. The string length should be between 0 and 256 characters. Valid characters include a-z, A-Z, 0-9, space, and the special characters _ - . : / = + @.
        public let value: String

        @inlinable
        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.key, name: "key", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            try self.validate(self.value, name: "value", parent: name, max: 256)
            try self.validate(self.value, name: "value", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for the applied quota. You can get this information by using the Service Quotas console, or by listing the quotas using the list-service-quotas CLI command or the ListServiceQuotas Amazon Web Services API operation.
        public let resourceARN: String
        /// The tags that you want to add to the resource.
        public let tags: [Tag]

        @inlinable
        public init(resourceARN: String, tags: [Tag]) {
            self.resourceARN = resourceARN
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, pattern: "^arn:aws(-[\\w]+)*:*:.+:[0-9]{12}:.+$")
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for the applied quota that you want to untag. You can get this information by using the Service Quotas console, or by listing the quotas using the list-service-quotas CLI command or the ListServiceQuotas Amazon Web Services API operation.
        public let resourceARN: String
        /// The keys of the tags that you want to remove from the resource.
        public let tagKeys: [String]

        @inlinable
        public init(resourceARN: String, tagKeys: [String]) {
            self.resourceARN = resourceARN
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, pattern: "^arn:aws(-[\\w]+)*:*:.+:[0-9]{12}:.+$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tagKeys = "TagKeys"
        }
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }
}

// MARK: - Errors

/// Error enum for ServiceQuotas
public struct ServiceQuotasErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case awsServiceAccessNotEnabledException = "AWSServiceAccessNotEnabledException"
        case dependencyAccessDeniedException = "DependencyAccessDeniedException"
        case illegalArgumentException = "IllegalArgumentException"
        case invalidPaginationTokenException = "InvalidPaginationTokenException"
        case invalidResourceStateException = "InvalidResourceStateException"
        case noAvailableOrganizationException = "NoAvailableOrganizationException"
        case noSuchResourceException = "NoSuchResourceException"
        case organizationNotInAllFeaturesModeException = "OrganizationNotInAllFeaturesModeException"
        case quotaExceededException = "QuotaExceededException"
        case resourceAlreadyExistsException = "ResourceAlreadyExistsException"
        case serviceException = "ServiceException"
        case serviceQuotaTemplateNotInUseException = "ServiceQuotaTemplateNotInUseException"
        case tagPolicyViolationException = "TagPolicyViolationException"
        case templatesNotAvailableInRegionException = "TemplatesNotAvailableInRegionException"
        case tooManyRequestsException = "TooManyRequestsException"
        case tooManyTagsException = "TooManyTagsException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize ServiceQuotas
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// You do not have sufficient permission to perform this action.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// The action you attempted is not allowed unless Service Access with Service Quotas is enabled in your organization.
    public static var awsServiceAccessNotEnabledException: Self { .init(.awsServiceAccessNotEnabledException) }
    /// You can't perform this action because a dependency does not have access.
    public static var dependencyAccessDeniedException: Self { .init(.dependencyAccessDeniedException) }
    /// Invalid input was provided.
    public static var illegalArgumentException: Self { .init(.illegalArgumentException) }
    /// Invalid input was provided.
    public static var invalidPaginationTokenException: Self { .init(.invalidPaginationTokenException) }
    /// The resource is in an invalid state.
    public static var invalidResourceStateException: Self { .init(.invalidResourceStateException) }
    /// The Amazon Web Services account making this call is not a member of an organization.
    public static var noAvailableOrganizationException: Self { .init(.noAvailableOrganizationException) }
    /// The specified resource does not exist.
    public static var noSuchResourceException: Self { .init(.noSuchResourceException) }
    /// The organization that your Amazon Web Services account belongs to is not in All Features mode.
    public static var organizationNotInAllFeaturesModeException: Self { .init(.organizationNotInAllFeaturesModeException) }
    /// You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use Service Quotas to request a service quota increase.
    public static var quotaExceededException: Self { .init(.quotaExceededException) }
    /// The specified resource already exists.
    public static var resourceAlreadyExistsException: Self { .init(.resourceAlreadyExistsException) }
    /// Something went wrong.
    public static var serviceException: Self { .init(.serviceException) }
    /// The quota request template is not associated with your organization.
    public static var serviceQuotaTemplateNotInUseException: Self { .init(.serviceQuotaTemplateNotInUseException) }
    /// The specified tag is a reserved word and cannot be used.
    public static var tagPolicyViolationException: Self { .init(.tagPolicyViolationException) }
    /// The Service Quotas template is not available in this Amazon Web Services Region.
    public static var templatesNotAvailableInRegionException: Self { .init(.templatesNotAvailableInRegionException) }
    /// Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase for this quota.
    public static var tooManyRequestsException: Self { .init(.tooManyRequestsException) }
    /// You've exceeded the number of tags allowed for a resource. For more information, see Tag restrictions in the Service Quotas User Guide.
    public static var tooManyTagsException: Self { .init(.tooManyTagsException) }
}

extension ServiceQuotasErrorType: Equatable {
    public static func == (lhs: ServiceQuotasErrorType, rhs: ServiceQuotasErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension ServiceQuotasErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
